home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / fft.lha / fft / vfft.dat < prev   
Text File  |  1993-08-08  |  8KB  |  300 lines

  1.  
  2.  
  3. ===============================================================================
  4.  
  5.         Verify Fast Fourier Transform Package
  6.  
  7.  
  8.  
  9. Verify the computed FFT of the AP series x[j]=j
  10. j = 0..7
  11.  
  12. Performing Complex FFT of AP series (IM part being set to 0)
  13. Verifying the Re part of the transform ...
  14. Verifying the Im part of the transform ...
  15. Two #4 elements of the vectors with values 2.44921e-16 and 0
  16. differ the most, though the deviation 2.44921e-16 is small
  17. Verifying the power spectrum ...
  18.  
  19. Performing FFT of a REAL AP sequence
  20. Check out that "Real" and Complex FFT give identical results
  21. Done
  22.  
  23.  
  24. Verify the computed FFT of the AP series x[j]=j
  25. j = 0..1023
  26.  
  27. Performing Complex FFT of AP series (IM part being set to 0)
  28. Verifying the Re part of the transform ...
  29. Verifying the Im part of the transform ...
  30. Two #512 elements of the vectors with values 3.13499e-14 and 0
  31. differ the most, though the deviation 3.13499e-14 is small
  32. Verifying the power spectrum ...
  33.  
  34. Performing FFT of a REAL AP sequence
  35. Check out that "Real" and Complex FFT give identical results
  36. Done
  37.  
  38.  
  39. Verify the computed FFT for x[j] = W^(-l*j)
  40. j = 0..1023, l=1
  41.  
  42. Performing Complex FFT
  43. Verifying the Re part of the transform ...
  44. Two #869 elements of the vectors with values 0 and 3.87654e-06
  45. differ the most, though the deviation 3.87654e-06 is small
  46. Verifying the Im part of the transform ...
  47. Two #897 elements of the vectors with values 0 and -3.21195e-14
  48. differ the most, though the deviation 3.21195e-14 is small
  49. Verifying the power spectrum ...
  50. Two #869 elements of the vectors with values 0 and 3.87654e-06
  51. differ the most, though the deviation 3.87654e-06 is small
  52.  
  53. Done
  54.  
  55.  
  56. Verify the computed FFT of the truncated AP sequence x[j]=j
  57. j = 0..7, with N=16
  58.  
  59. Performing Complex FFT (with IM part being set to 0)
  60.  
  61. Source Vector              0.0000  1.0000  2.0000  3.0000  4.0000  5.0000  6.0000  7.0000 
  62.  
  63. Computed cos transform    28.0000 -9.1371 -4.0000  2.3801 -4.0000  3.2768 -4.0000  3.4802 -4.0000  3.4802 -4.0000  3.2768 -4.0000  2.3801 -4.0000 -9.1371 
  64.  
  65. Computed sin transform     0.0000 -20.1094  9.6569 -5.9864  4.0000 -2.6727  1.6569 -0.7956  0.0000  0.7956 -1.6569  2.6727 -4.0000  5.9864 -9.6569 20.1094 
  66. Verifying the Re part of the transform ...
  67. Verifying the Im part of the transform ...
  68. Two #8 elements of the vectors with values 2.44921e-16 and 0
  69. differ the most, though the deviation 2.44921e-16 is small
  70. Verifying the power spectrum ...
  71.  
  72. Performing FFT of a REAL AP sequence
  73. Check out that "Real" and Complex FFT give identical results
  74. Check out the functions returning the half of the transform
  75.  
  76. Done
  77.  
  78.  
  79. Verify the computed FFT of the truncated AP sequence x[j]=j
  80. j = 0..511, with N=1024
  81.  
  82. Performing Complex FFT (with IM part being set to 0)
  83. Verifying the Re part of the transform ...
  84. Verifying the Im part of the transform ...
  85. Two #512 elements of the vectors with values 1.5675e-14 and 0
  86. differ the most, though the deviation 1.5675e-14 is small
  87. Verifying the power spectrum ...
  88.  
  89. Performing FFT of a REAL AP sequence
  90. Check out that "Real" and Complex FFT give identical results
  91. Check out the functions returning the half of the transform
  92.  
  93. Done
  94.  
  95.  
  96. Verify the sin/cos transform for the following example
  97.     r*exp( -r/a )    <=== sin-transform ===>    2a^3 k/(1 + (ak)^2)^2
  98.     r*exp( -r/a )    <=== cos-transform ===>    a^2 (1-(ak)^2)/(1 + (ak)^2)^2
  99.  
  100. Parameter a is 4.00
  101. No. of grids   512
  102. Grid mesh in the r-space dr = 0.039
  103. Grid mesh in the k-space dk = 0.157
  104. Check out the inquires to FFT package about N, dr, dk, cutoffs
  105.  
  106.  
  107. Comparison of two Matrices:
  108.     Computed and Exact sin-transform
  109. Matrix 0:511x1:1 ''
  110. Matrix 0:511x1:1 ''
  111. Maximal discrepancy            0.312458
  112.    occured at the point        (1,1)
  113.  Matrix 1 element is            10.6476
  114.  Matrix 2 element is            10.3351
  115.  Absolute error v2[i]-v1[i]        -0.312458
  116.  Relative error                -0.0297824
  117.  
  118. ||Matrix 1||               26.1276
  119. ||Matrix 2||               23.5973
  120. ||Matrix1-Matrix2||                4.69511
  121. ||Matrix1-Matrix2||/sqrt(||Matrix1|| ||Matrix2||)    0.189089
  122.  
  123.  
  124.  
  125. Comparison of two Matrices:
  126.     Computed and Exact cos-transform
  127. Matrix 0:511x1:1 ''
  128. Matrix 0:511x1:1 ''
  129. Maximal discrepancy            0.649606
  130.    occured at the point        (0,1)
  131.  Matrix 1 element is            15.3504
  132.  Matrix 2 element is            16
  133.  Absolute error v2[i]-v1[i]        0.649606
  134.  Relative error                0.0414416
  135.  
  136. ||Matrix 1||               34.543
  137. ||Matrix 2||               33.8396
  138. ||Matrix1-Matrix2||                3.01891
  139. ||Matrix1-Matrix2||/sqrt(||Matrix1|| ||Matrix2||)    0.0882996
  140.  
  141.  
  142.  
  143. Comparison of two Matrices:
  144.     Computed cos-transform with DC component removed, and exact result
  145. Matrix 0:511x1:1 ''
  146. Matrix 0:511x1:1 ''
  147. Maximal discrepancy            0.651867
  148.    occured at the point        (0,1)
  149.  Matrix 1 element is            15.3481
  150.  Matrix 2 element is            16
  151.  Absolute error v2[i]-v1[i]        0.651867
  152.  Relative error                0.0415889
  153.  
  154. ||Matrix 1||               34.9727
  155. ||Matrix 2||               33.8396
  156. ||Matrix1-Matrix2||                3.01892
  157. ||Matrix1-Matrix2||/sqrt(||Matrix1|| ||Matrix2||)    0.0877554
  158.  
  159.  
  160.  
  161. Comparison of two Matrices:
  162.     Computed inverse sin-transform vs the original function
  163. Matrix 0:511x1:1 ''
  164. Matrix 0:511x1:1 ''
  165. Maximal discrepancy            5.96046e-08
  166.    occured at the point        (221,1)
  167.  Matrix 1 element is            0.997371
  168.  Matrix 2 element is            0.997371
  169.  Absolute error v2[i]-v1[i]        5.96046e-08
  170.  Relative error                5.97618e-08
  171.  
  172. ||Matrix 1||               392.97
  173. ||Matrix 2||               392.97
  174. ||Matrix1-Matrix2||                1.12206e-05
  175. ||Matrix1-Matrix2||/sqrt(||Matrix1|| ||Matrix2||)    2.85533e-08
  176.  
  177.  
  178.  
  179. Comparison of two Matrices:
  180.     Computed inverse cos-transform vs the original function
  181. Matrix 0:511x1:1 ''
  182. Matrix 0:511x1:1 ''
  183. Maximal discrepancy            0.767671
  184.    occured at the point        (58,1)
  185.  Matrix 1 element is            2.05355
  186.  Matrix 2 element is            1.28588
  187.  Absolute error v2[i]-v1[i]        -0.767671
  188.  Relative error                -0.459761
  189.  
  190. ||Matrix 1||               785.94
  191. ||Matrix 2||               392.97
  192. ||Matrix1-Matrix2||                392.97
  193. ||Matrix1-Matrix2||/sqrt(||Matrix1|| ||Matrix2||)    0.707107
  194.  
  195.  
  196.  
  197. Comparison of two Matrices:
  198.     Computed inverse cos-transform with DC component removed,
  199. and the original function
  200. Matrix 0:511x1:1 ''
  201. Matrix 0:511x1:1 ''
  202. Maximal discrepancy            0.135816
  203.    occured at the point        (55,1)
  204.  Matrix 1 element is            1.11981
  205.  Matrix 2 element is            1.25562
  206.  Absolute error v2[i]-v1[i]        0.135816
  207.  Relative error                0.11435
  208.  
  209. ||Matrix 1||               324.137
  210. ||Matrix 2||               392.97
  211. ||Matrix1-Matrix2||                69.4601
  212. ||Matrix1-Matrix2||/sqrt(||Matrix1|| ||Matrix2||)    0.194622
  213.  
  214.  
  215. Done
  216.  
  217.  
  218. Verify the sin/cos transform for the following example
  219.     exp( -r^2/4a )    <=== cos-transform ===> sqrt(a*pi) exp(-a*k^2)
  220.  
  221. Parameter a is 4.00
  222. No. of grids   512
  223. Grid mesh in the r-space dr = 0.039
  224. Grid mesh in the k-space dk = 0.157
  225. Check out the inquires to FFT package about N, dr, dk, cutoffs
  226.  
  227.  
  228. Comparison of two Matrices:
  229.     Computed and Exact cos-transform
  230. Matrix 0:511x1:1 ''
  231. Matrix 0:511x1:1 ''
  232. Maximal discrepancy            0.0195313
  233.    occured at the point        (18,1)
  234.  Matrix 1 element is            0.0195313
  235.  Matrix 2 element is            4.5914e-14
  236.  Absolute error v2[i]-v1[i]        -0.0195313
  237.  Relative error                -2
  238.  
  239. ||Matrix 1||               21.7725
  240. ||Matrix 2||               11.7725
  241. ||Matrix1-Matrix2||                10
  242. ||Matrix1-Matrix2||/sqrt(||Matrix1|| ||Matrix2||)    0.624616
  243.  
  244.  
  245.  
  246. Comparison of two Matrices:
  247.     Computed with DC removed, and Exact cos-transform
  248. Matrix 0:511x1:1 ''
  249. Matrix 0:511x1:1 ''
  250. Maximal discrepancy            2.23517e-08
  251.    occured at the point        (350,1)
  252.  Matrix 1 element is            -2.23517e-08
  253.  Matrix 2 element is            0
  254.  Absolute error v2[i]-v1[i]        2.23517e-08
  255.  Relative error                0.223517
  256.  
  257. ||Matrix 1||               11.7725
  258. ||Matrix 2||               11.7725
  259. ||Matrix1-Matrix2||                3.91315e-06
  260. ||Matrix1-Matrix2||/sqrt(||Matrix1|| ||Matrix2||)    3.32399e-07
  261.  
  262.  
  263.  
  264. Comparison of two Matrices:
  265.     Computed inverse cos-transform vs the original function
  266. Matrix 0:511x1:1 ''
  267. Matrix 0:511x1:1 ''
  268. Maximal discrepancy            0.177245
  269.    occured at the point        (2,1)
  270.  Matrix 1 element is            1.17686
  271.  Matrix 2 element is            0.999619
  272.  Absolute error v2[i]-v1[i]        -0.177245
  273.  Relative error                -0.162873
  274.  
  275. ||Matrix 1||               181.999
  276. ||Matrix 2||               91.2496
  277. ||Matrix1-Matrix2||                90.7496
  278. ||Matrix1-Matrix2||/sqrt(||Matrix1|| ||Matrix2||)    0.704198
  279.  
  280.  
  281.  
  282. Comparison of two Matrices:
  283.     Computed inverse with DC removed vs the original
  284. Matrix 0:511x1:1 ''
  285. Matrix 0:511x1:1 ''
  286. Maximal discrepancy            3.57628e-07
  287.    occured at the point        (0,1)
  288.  Matrix 1 element is            1
  289.  Matrix 2 element is            1
  290.  Absolute error v2[i]-v1[i]        3.57628e-07
  291.  Relative error                3.57628e-07
  292.  
  293. ||Matrix 1||               91.2496
  294. ||Matrix 2||               91.2496
  295. ||Matrix1-Matrix2||                6.16255e-06
  296. ||Matrix1-Matrix2||/sqrt(||Matrix1|| ||Matrix2||)    6.75351e-08
  297.  
  298.  
  299. Done
  300.